<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("basePath", basePath);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'Page.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<jsp:include page="/scripts/common/index.html"></jsp:include>
<jsp:include page="/scripts/jquery/index.html"></jsp:include>
<jsp:include page="/scripts/dhtmlx/index.html"></jsp:include>
<jsp:include page="/scripts/bootstrap/index.html"></jsp:include>
<jsp:include page="/scripts/dhtmlxgant/index.html"></jsp:include>
<link rel="stylesheet" href="${basePath }style/default.css">
<script>
	var myGrid;
	function init() {
		clickFun();
		addNode();
		query();
	}
	function addNode() {
		var str = "<div id='example5' class='ezmodal'></div><input type='text' id='sucessUrl' style='display:none'/>";
		$("body").append(str);
	}
	function clickFun() {
		//新增
		$("#add").click(function() {
			SN.getWindowByUrl("新增XXX", "800", "400", "${basePath}page/model/Page/toAdd", {});
		});
		//修改
		$("#update").click(function() {
			SN.getWindowByUrl("修改XXX", "800", "400", "${basePath}page/model/Page/toUpd", {});
		});
		//浏览
		$("#view").click(function() {
			SN.getWindowByUrl("浏览XXX", "800", "400", "${basePath}page/model/Page/toView", {});
		});
		//重置
		$("#repeat").click(function() {
			window.location.reload();
		});
		//刷新
		$("#refresh").click(function() {
			query();
		});
	}
	//双击事件
	function func(id){
		//  alert(id);
		SN.getWindowByUrl("浏览XXX", "800", "400", "${basePath}page/model/Page/toView", {id:id});
	}
	function query() {
		$.ajax({
				type : 'POST' ,
				url : 'page/model/Page/queryGant' ,
				data : {} ,
				dataType : "json" ,
				async : true ,
				cache : false ,
				jsonpCallback : "null" ,
				//beforeSend : function(response, status, statusText) {
				//alert(response + ":" + status + ":" + statusText);
				//} ,
				//dataFilter : function(response, status, statusText) {
				//alert(response + ":" + status + ":" + statusText);
				//} ,
				success : function(response, status, statusText) {
					console.debug(response);
					if (response.status) {
						setValue(response.content);
					} else {
						alert();
					}
				} ,
				error : function(response, status, statusText) {
					//alert(response + ":" + status + ":" + statusText);
				} ,
				complete : function(response, status, statusText) {
					//alert(response + ":" + status + ":" + statusText);
				}
		});
	}
</script>
</head>
<body onload="init()">
	<table class="listTableClass" border="0" cellpadding="0" cellspacing="0">
		<tr class="queryClass">
			<td>
				<table style="width:98%;margin-left:15px;" border="0">
					<tr>
						<td style="width:5%">姓名：</td>
						<td style="width:20%">
							<input type="text" class="form-control">
						</td>
						<td>
							<button onclick="query()" class="btn btn-primary" type="button">
								<span>查询</span>
							</button>
							<button class="btn btn-primary" type="reset">
								<span>清空</span>
							</button>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr class="listTrClass">
			<td valign="top">
				<table class="listTableClass">
					<tr class="listContClass">
						<td>
							<div>
								<button class="btn btn-primary" id="add">
									<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
									&nbsp;
									<span>新增</span>
								</button>
								<button class="btn btn-primary" id="update">
									<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
									&nbsp;
									<span>修改</span>
								</button>
								<button class="btn btn-primary" id="refresh">
									<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
									&nbsp;
									<span>刷新</span>
								</button>
								<button class="btn btn-primary" id="repeat">
									<span class="glyphicon glyphicon-repeat" aria-hidden="true"></span>
									&nbsp;
									<span>重置</span>
								</button>
							</div>
						</td>
					</tr>
					<tr class="listTrClass">
						<td>
							<jsp:include page="/common/gant_toolbar.jsp">
								<jsp:param value="setValue" name="setValue" />
								<jsp:param value="func" name="func" />
								<jsp:param value="getValue" name="getValue" />
								<jsp:param value="getGant" name="getGant" />
							</jsp:include>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>
